<script>
const s = new Set()
;[1,2,3,12,3,2,1,4].forEach((n) => s.add(n))
for(let i of s) {
  console.log(i)
}

const s1 = new Set()
s1.add(5)
s1.add('5')
s1.add([])
s1.add([])
console.log([...s1]) // 5, '5', [], []
const arr1 = [...s1]
const arr2 = Array.from(s1)

console.log(s1.keys(), [...s1.keys()])
console.log(s1.values(), [...s1.values()])
console.log(s1.entries(), [...s1.entries()])

function unique(arr) {
  return [... new Set(arr)]
}
</script>